/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ch.simas.javaforum.service;

import java.util.concurrent.Future;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ejb.AsyncResult;
import javax.ejb.Asynchronous;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;

/**
 *
 * @author sim_mas
 */
@Stateless
@LocalBean
public class AsyncService {

    private static Logger logger = Logger.getLogger(AsyncService.class.getName());

    @Asynchronous
    public Future<String> asyncCall() {
        try {
            Thread.sleep(10000);
        } catch (InterruptedException ex) {
            logger.log(Level.SEVERE, null, ex);
        }

        return new AsyncResult<String>("Test");
    }
}
